package test.excel;

import java.util.Date;
import java.util.LinkedHashSet;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;

public class FakeTable {
    private String name;

    private Table<Integer, Integer, Object> table = HashBasedTable.create();

    private LinkedHashSet<FakeTableColumn> columns = new LinkedHashSet<FakeTableColumn>();

    public FakeTable(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void addColumn(String name, int type) {
        columns.add(new FakeTableColumn(name, type));
    }

    public void setInt(int col, int row, int val) {
        table.put(row, col, val);
    }

    public void setDouble(int col, int row, double val) {
        table.put(row, col, val);
    }

    public void setDate(int col, int row, Date val) {
        table.put(row, col, val);
    }

    public void setString(int col, int row, String val) {
        table.put(row, col, val);
    }
}

class FakeTableColumn {
    private String name;

    private int type;

    public FakeTableColumn(String name, int type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public int getType() {
        return type;
    }
}
